package com.javatip.project.deep_learning.trainMission.mapper;

import com.javatip.project.deep_learning.trainMission.domain.TrainMission;
import java.util.List;	

/**
 * 训练任务 数据层
 * 
 * @author 袁伟
 * @date 2024-07-12
 */
public interface TrainMissionMapper 
{
	/**
     * 查询训练任务信息
     * 
     * @param id 训练任务ID
     * @return 训练任务信息
     */
	public TrainMission selectTrainMissionById(Integer id);
	
	/**
     * 查询训练任务列表
     * 
     * @param trainMission 训练任务信息
     * @return 训练任务集合
     */
	public List<TrainMission> selectTrainMissionList(TrainMission trainMission);
	
	/**
     * 新增训练任务
     * 
     * @param trainMission 训练任务信息
     * @return 结果
     */
	public int insertTrainMission(TrainMission trainMission);
	
	/**
     * 修改训练任务
     * 
     * @param trainMission 训练任务信息
     * @return 结果
     */
	public int updateTrainMission(TrainMission trainMission);
	
	/**
     * 删除训练任务
     * 
     * @param id 训练任务ID
     * @return 结果
     */
	public int deleteTrainMissionById(Integer id);
	
	/**
     * 批量删除训练任务
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	public int deleteTrainMissionByIds(String[] ids);

    public List<TrainMission> selectWaitAndTrainingList();

	/**
	 * 是否有正在训练的任务
	 */
	public int isTraining();

	public List<TrainMission> queryStatusWaitList(TrainMission trainMission);

	List<TrainMission> selectFinishedList(TrainMission trainMission);

	public void setTimeToQueue(int id);

	 public void setTimeToQueueNull(int id);

     public Integer isTrainMissionNameExists(String name,int userId);

	public List<TrainMission> queryStatusTrainingList();

	public List<TrainMission> selectAllTrainMissionsOrderedByTime();

	public List<TrainMission> selectTrainMissionListByUser(int userId, TrainMission trainMission);

	public List<TrainMission> selectTrainMissionListWithUserOrPublic(Integer currentUserId, TrainMission trainMission);
}